/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class RetrieveAndUpdateBdcombustibleData {
	public void retrieveAndUpdateTestData() throws PersistentException {
		PersistentTransaction t = orm.Bdprueba2PdsPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.Tp_logDAO lormTp_logDAO = lDAOFactory.getTp_logDAO();
			orm.Tp_log lormTp_log = lormTp_logDAO.loadTp_logByQuery(null, null);
			// Update the properties of the persistent object
			lormTp_logDAO.save(lormTp_log);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public void retrieveByCriteria() throws PersistentException {
		System.out.println("Retrieving Tp_log by Tp_logCriteria");
		orm.Tp_logCriteria tp_logCriteria = new orm.Tp_logCriteria();
		// Please uncomment the follow line and fill in parameter(s)
		//tp_logCriteria.l_id.eq();
		System.out.println(tp_logCriteria.uniqueTp_log());
		
	}
	
	
	public static void main(String[] args) {
		try {
			RetrieveAndUpdateBdcombustibleData retrieveAndUpdateBdcombustibleData = new RetrieveAndUpdateBdcombustibleData();
			try {
				retrieveAndUpdateBdcombustibleData.retrieveAndUpdateTestData();
				//retrieveAndUpdateBdcombustibleData.retrieveByCriteria();
			}
			finally {
				orm.Bdprueba2PdsPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
